import { createHashRouter } from 'react-router-dom'
import { lazy } from 'react'
export const routes = [
    {
        path: '/',
        Component: lazy(() => import('../views/Root')),
        children: [
            {
                index: true,
                Component: lazy(() => import('../views/Home'))
            },
            {
                path: '/login',
                Component: lazy(() => import('../views/Login'))
            },
            {
                path: '/my',
                Component: lazy(() => import('../views/My'))
            },
            {
                path: '/appoint',
                Component: lazy(() => import('../views/Appoint'))
            },
            {
                path: '/doctor',
                Component: lazy(() => import('../views/Doctor'))
            },
            {
                path: '/appointAdd',
                Component: lazy(() => import('../views/AppointAdd'))
            },
            {
                path: '/business/:id',
                Component: lazy(() => import('../views/Business'))
            },
            {
                path: '/profile',
                Component: lazy(() => import('../views/Profile'))
            },
            {
                path: '*',
                Component: lazy(() => import('../views/NotFound'))
            }
        ]
    },

]
// 创建路由实例
const router = createHashRouter(routes)
export default router